package com.example.aiagent.service;

import com.alibaba.dashscope.aigc.multimodalconversation.MultiModalConversationResult;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.exception.UploadFileException;
import com.example.aiagent.model.entity.User;
import io.reactivex.Flowable;
import reactor.core.publisher.Flux;

import java.io.IOException;

public interface AppService {

    /**
     * 同步输出
     * @param message
     * @param appId
     * @param loginUser
     * @return
     */
    String doChatSync(String message, Long appId, User loginUser, Long aiId);

    /**
     * 流式对话
     * @param message
     * @param appId
     * @param loginUser
     * @return
     */
    public Flux<String> doChatWithStream(String message, Long appId, User loginUser, Long aiId);

    /**
     * 删除会话
     * @param chatId
     * @param loginUser
     * @return
     */
    int deleteApp(Long chatId, User loginUser);

    /**
     * 办公文件
     * @param message
     * @param appId
     * @param loginUser
     * @param fileName
     * @return
     */
    Flux<String> doChatWithDoc(String message, Long appId, User loginUser, String fileName);

    /**
     * 图片
     * @param message
     * @param appId
     * @param loginUser
     * @param fileName
     * @return
     * @throws NoApiKeyException
     * @throws UploadFileException
     * @throws IOException
     */
    Flux<String> doChatWithImg(String message, Long appId, User loginUser, String fileName) throws NoApiKeyException, UploadFileException, IOException;

    /**
     * dify平台文本
     * @param message
     * @param chatId
     * @return
     */
    String dotextToAudio(String message, Long chatId, Long aiId);
}
